####################
####### PS 1 #######
#plain vanilla
#PS1="\u@\h \w> "
#PS1="\$(date +%Y%m%d) \t \u@\h \w \$ "
PS1="\$(date +%Y%m%d) \t \u@\h \w \$ "


####################
####### PATH #######
export PATH=$PATH:~/bin:~/.cabal/bin

####################
####### MORE #######
GITTINGS="$HOME/gittings/"
. $GITTINGS/radiodigit/.radiorc

########################
########################
####### aliases ########
alias ovh='ssh digit@ovhtoo'
alias ovhprox='ssh -C2qTnN -D 8080 digit@ovhtoo -M -S /tmp/digit@ovhtoo:22'

#####################
####### media #######
#same pitch at speed
alias mpv='mpv -af scaletempo'
#just music
alias mpvm='mpv --no-video $1'
#juicy
alias mplease='mpv --ytdl-format=160'
#real juicy
alias mpleep='mpv --ytdl-format=171'
#freedom fave
alias mp43='mpv --ytdl-format=43'
#bandwidthsalv
alias mp5='mpv --ytdl-format=5'

#do you have a fascbook?
fascbook(){ mp43 "https://www.youtube.com/watch?v=JotAOgXFxSs" ; facebook ; }
#facebook(){ mp43 "https://www.youtube.com/watch?v=JotAOgXFxSs" ; fascbook ; }


#formats list
#140          m4a        audio only DASH audio  131k , m4a_dash container, aac  @128k (44100Hz), 52.45MiB
#171          webm       audio only DASH audio  149k , audio@128k (44100Hz), 45.90MiB
#141          m4a        audio only DASH audio  258k , m4a_dash container, aac  @256k (44100Hz), 105.30MiB
#160          mp4        254x144    DASH video  122k , 15fps, video only, 45.56MiB
#242          webm       424x240    DASH video  217k , 1fps, video only, 78.30MiB
#133          mp4        424x240    DASH video  256k , 25fps, video only, 100.82MiB
#243          webm       636x360    DASH video  418k , 1fps, video only, 145.27MiB
#134          mp4        636x360    DASH video  615k , 25fps, video only, 221.03MiB
#244          webm       848x480    DASH video  844k , 1fps, video only, 290.09MiB
#135          mp4        848x480    DASH video 1119k , 25fps, video only, 424.25MiB
#247          webm       1270x720   DASH video 1429k , 1fps, video only, 500.26MiB
#136          mp4        1270x720   DASH video 2245k , 25fps, video only, 806.59MiB
#248          webm       1906x1080  DASH video 2849k , 1fps, video only, 1.01GiB
#137          mp4        1906x1080  DASH video 4257k , 25fps, video only, 1.37GiB
#17           3gp        176x144    
#36           3gp        320x240    
#5            flv        400x240    
#43           webm       640x360    
#18           mp4        640x360    
#22           mp4        1280x720   (best)


##############################################
####### nixos/ package manager aliases #######
# install package
alias nei='nix-env -i'
# uninstall package
alias nee='nix-env -e'
# search
alias neqag='nix-env -qa \* | grep'
alias neaqg='nix-env -qa \* | grep'
# list all available
alias neqa='nix-env -qa \*'
alias neaq='nix-env -qa \*'
# list installed 
alias neq='nix-env -q \*'
# search installed
alias neq='nix-env -q \* | grep'
# update available packages list ( i think )
alias ncu='nix-channel --update'
# upgrade --dry-run
alias neup='nix-env -u --dry-run'
alias neudr='nix-env -u --dry-run'
# upgrade (wait!  only run as root at / ... or some warning like that iirc)
alias neu='nix-env -u'
# undooooooo!
alias nerb='nix-env --rollback'
# roll back to $n
alias nesg='nix-env --switch-generation '
# list available rollbacks
alias nelg='nix-env --list-generations'
#another search
neps(){ nix-env -qa \* -P | fgrep -i "$1"; }

##### digit's new alternate nixos package search model
### update package list
alias dpu='nix-env -qa > ~/packages'
### list package
#alias dpl='cat ~/packages'
alias dpl='less ~/packages'
### search package
dps(){ cat ~/packages | grep "$1"; }
### install package
dpi(){ nix-env -i "$1"; }

############################
####### XBPS ALIASES #######
####### & FUNCTIONS. ####### 

alias xbps-list='xbps-list-packages-ypnosestyle'

xbps-flatlist(){
    xbps-list-packages-ypnosestyle > xqlotmp
    sed 's/$/ /g' xqlotmp | tr -d '\n' ; echo
    rm xqlotmp
}

xbps-list-packages-ypnosestyle(){
    xbps-query -m | while IFS=$'\n' read -r PKG; do echo "${PKG%-*}"; done
}

xbps-list-packages-domstyle(){
    xbps-query -m | rev | cut -d"-" -f2- | rev
}

###########################
####################
#### special one!
### as seen on archwiki for skype.
alias fyafox='xhost +local: && su fox -c firefox'

#second version, after wheel trick
alias ffox='xhost +local: && sudo -u fox /nix/store/w53y2zxglxpswfnl8y3y93jm11cr4jfx-firefox-35.0/bin/firefox'

#easy clear
alias l='clear'

#shortcut
LOADINGBAY='ovhtoo:/home/digit/stuff/ninudeskia/ryverdyak/loadingbay'

#################################
### RADIO GA GA ### RADIO GOO GOO

#hard house
#alias radiohardhouse='mpv ~/c/radio/hhuk.ogg.m3u'
#soundscape
#alias radiodrone='mpv ~/c/radio/dronezone56.pls'
#trance
#alias radiotrance='mpv ~/c/radio/thetrip.pls'
#elite
#alias radioelite="mpv http://listen.radionomy.com/radio-sidewinder.m3u"
#radioelite="mpv ~/c/radio/radio-sidewinder.m3u"

###
## funky functions

#orbea's slackware package searchery
slackpkgsearch(){
( cd /var/log/packages/ ; grep -x 'U.*M' * ) | awk -F: '{print $3 "\t" $1}' | sort -n 
}

source ~/.xsh

